/*
 * @Author: rxn 1003312535@qq.com
 * @Date: 2024-02-28 10:35:44
 * @LastEditors: rxn 1003312535@qq.com
 * @LastEditTime: 2024-07-25 14:49:39
 * @FilePath: \TS-study\js\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
"use strict";
/**
 * 泛型
 */
function getData(str) {
    return str;
}
getData("字符串类型");
const fun1 = (num) => {
    return num;
};
fun1(1);
const a = 111;
class minClas {
    constructor() {
        this.list = [];
    }
    add(num) {
        this.list.push(num);
    }
    min() {
        let result = this.list[0];
        for (let i = 0; i < this.list.length; i++) {
            if (this.list[i] < result) {
                result = this.list[i];
            }
        }
        console.log(result);
    }
}
let aa = new minClas();
aa.add(1);
aa.add(2);
aa.add(3);
aa.min();
//类作为参数的泛型
class User {
}
class Mysql {
    add(params) {
        console.log(params);
        return true;
    }
    update(params) {
        console.log(params);
        return true;
    }
}
let user = new User();
user.username = "Ren";
user.password = "123456";
let mysql = new Mysql();
mysql.add(user);
